import {parseTime, request} from "../../utils/util";

Page({
  data: {
    details: {},
  },
  // 获取列表数据
  getDetail() {
    request({
      url: `/api/web/messages/${this.options.id}`,
      success: ({ code, data }) => {
        if (code === 200) {
          data.created_at_show = parseTime(data.created_at, '{y}/{m}/{d} {h}:{i}')
          this.setData({
            details: data
          })
        }
      }
    })
  },
  onShow () {
    wx.setNavigationBarColor({
      frontColor: '#000000',
      backgroundColor: '#000000',
      animation: {
        duration: 400,
        timingFunc: 'easeIn'
      }
    })
    this.getDetail()
  }
})
